<template>
    <view class="video coreshop-margin-left-10 coreshop-margin-right-10  coreshop-margin-bottom-10">
        <video class="videoCT" id="myVideo" :src="coreshopData.parameters.list[0].url" :autoplay="autoplay" :poster="coreshopData.parameters.list[0].image"></video>
    </view>
</template>

<script>
    export default {
        name: "coreshopVideo",
        props: {
            coreshopData: {
                type: Object,
                required: true,
            }
        },
        data() {
            return {
                autoplay: false
            }
        },
        created() {
            if (this.coreshopData.parameters.autoplay == 'true' || this.coreshopData.parameters.autoplay == true) {
                this.autoplay = true;
            }

        },
        onReady: function (res) {
            // #ifndef MP-ALIPAY
            this.videoContext = uni.createVideoContext('myVideo')
            // #endif
        },
        methods: {

        }
    }
</script>

<style lang="scss" scoped>
    .video { border-radius: 8px;
        .videoCT { width: 100%; min-height: 100px; }
    }
</style>
